 
<div class="mws-panel grid_8 mws-collapsible  terms">
  <div class="mws-panel-header">
     <span class="mws-i-24 i-table-1"><?php  echo __('Term'); ?></span>
   <div class="mws-collapse-button mws-inset"><span></span></div>
 </div>
<div class="mws-panel-body" style="display: block; direction:rtl;">
  <div class="right_direction"> 
  <table class="mws-table">
      <tbody>
		<tr><td class="left_header"><?php echo __('Id'); ?></td>
		<td>
			<?php echo h($term['Term']['id']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Name'); ?></td>
		<td>
			<?php echo h($term['Term']['name']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('User'); ?></td>
		<td>
			<?php echo $this->Html->link($term['User']['id'], array('controller' => 'users', 'action' => 'view', $term['User']['id'])); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Created'); ?></td>
		<td>
			<?php echo h($term['Term']['created']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Modified'); ?></td>
		<td>
			<?php echo h($term['Term']['modified']); ?>
			&nbsp;
		</td></tr>
	</tbody>
	</table>
</div>
</div>

<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Term'), array('action' => 'edit', $term['Term']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete Term'), array('action' => 'delete', $term['Term']['id']), null, __('Are you sure you want to delete # %s?', $term['Term']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Terms'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Term'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Periodexams'), array('controller' => 'periodexams', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Periodexam'), array('controller' => 'periodexams', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Subjects'), array('controller' => 'subjects', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Subject'), array('controller' => 'subjects', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related Periodexams'); ?></h3>
	<?php if (!empty($term['Periodexam'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Name'); ?></th>
		<th><?php echo __('Uniyear Id'); ?></th>
		<th><?php echo __('Type'); ?></th>
		<th><?php echo __('Branch Id'); ?></th>
		<th><?php echo __('Term Id'); ?></th>
		<th><?php echo __('Start Date'); ?></th>
		<th><?php echo __('End Date'); ?></th>
		<th><?php echo __('Place'); ?></th>
		<th><?php echo __('User Id'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Modified'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($term['Periodexam'] as $periodexam): ?>
		<tr>
			<td><?php echo $periodexam['id']; ?></td>
			<td><?php echo $periodexam['name']; ?></td>
			<td><?php echo $periodexam['uniyear_id']; ?></td>
			<td><?php echo $periodexam['type']; ?></td>
			<td><?php echo $periodexam['branch_id']; ?></td>
			<td><?php echo $periodexam['term_id']; ?></td>
			<td><?php echo $periodexam['start_date']; ?></td>
			<td><?php echo $periodexam['end_date']; ?></td>
			<td><?php echo $periodexam['place']; ?></td>
			<td><?php echo $periodexam['user_id']; ?></td>
			<td><?php echo $periodexam['created']; ?></td>
			<td><?php echo $periodexam['modified']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'periodexams', 'action' => 'view', $periodexam['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'periodexams', 'action' => 'edit', $periodexam['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'periodexams', 'action' => 'delete', $periodexam['id']), null, __('Are you sure you want to delete # %s?', $periodexam['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Periodexam'), array('controller' => 'periodexams', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Subjects'); ?></h3>
	<?php if (!empty($term['Subject'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Name'); ?></th>
		<th><?php echo __('Code'); ?></th>
		<th><?php echo __('Term Id'); ?></th>
		<th><?php echo __('Oral Limit'); ?></th>
		<th><?php echo __('Oral Success'); ?></th>
		<th><?php echo __('Written Limit'); ?></th>
		<th><?php echo __('Written Success'); ?></th>
		<th><?php echo __('Midterm Limit'); ?></th>
		<th><?php echo __('Midterm Success'); ?></th>
		<th><?php echo __('Practical Limit'); ?></th>
		<th><?php echo __('Practical Success'); ?></th>
		<th><?php echo __('Mark Limit'); ?></th>
		<th><?php echo __('Mark Success'); ?></th>
		<th><?php echo __('Active'); ?></th>
		<th><?php echo __('Order'); ?></th>
		<th><?php echo __('User Id'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Modified'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($term['Subject'] as $subject): ?>
		<tr>
			<td><?php echo $subject['id']; ?></td>
			<td><?php echo $subject['name']; ?></td>
			<td><?php echo $subject['code']; ?></td>
			<td><?php echo $subject['term_id']; ?></td>
			<td><?php echo $subject['oral_limit']; ?></td>
			<td><?php echo $subject['oral_success']; ?></td>
			<td><?php echo $subject['written_limit']; ?></td>
			<td><?php echo $subject['written_success']; ?></td>
			<td><?php echo $subject['midterm_limit']; ?></td>
			<td><?php echo $subject['midterm_success']; ?></td>
			<td><?php echo $subject['practical_limit']; ?></td>
			<td><?php echo $subject['practical_success']; ?></td>
			<td><?php echo $subject['mark_limit']; ?></td>
			<td><?php echo $subject['mark_success']; ?></td>
			<td><?php echo $subject['active']; ?></td>
			<td><?php echo $subject['order']; ?></td>
			<td><?php echo $subject['user_id']; ?></td>
			<td><?php echo $subject['created']; ?></td>
			<td><?php echo $subject['modified']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'subjects', 'action' => 'view', $subject['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'subjects', 'action' => 'edit', $subject['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'subjects', 'action' => 'delete', $subject['id']), null, __('Are you sure you want to delete # %s?', $subject['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Subject'), array('controller' => 'subjects', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
